package org.springblade.modules.platform.vo.enums;

import java.util.HashMap;
import java.util.Map;

public enum ModelEnum {

	CMD("cmd","下发命令关键字"),
	NEEDRESPONSE("needResponse","是否需要回复"),
	DEVICEID("deviceId","网关编号"),
	CMDSEQ("cmdSeq","命令序号"),
	CHLNO("chlNo","通道号（网关下的通道编号）"),
	CHLDEVICEID("chlDeviceId","网关子设备编号"),
	CHLDEVICETYPE("chlDeviceType","子设备设备产品编号"),

	CHLJSONVER("chlJsonVer","子设备版本"),
	SELFCHECKSTATUS("selfCheckStatus","网关通道状态"),
	CHLSTATE("chlstate","（deviceControl）子设备操作命令字opera操作、bind绑定，modify修改，del删除、query查询、reset重置"),
	;



	private String code;
	private String msg;

	private static Map<String, ModelEnum> valueMap;

	static {
		valueMap = new HashMap<>();
		for (ModelEnum e : values()){
			valueMap.put(e.code, e);
		}
	}
	ModelEnum(String code, String msg){
		this.code = code;
		this.msg = msg;
	}
	public static ModelEnum getEnum(String key) {
		if (!valueMap.containsKey(key)) {
			return null;
		}
		return valueMap.get(key);
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}
}
